package javase2.day06;

public class Demo3 {
	public static void main(String[] args) {
		Person p1 = new Person();
		Person p2 = new Person();
		Person p3= new Person();
		p1.setPriority(Thread.MIN_PRIORITY);
		p2.setPriority(Thread.MAX_PRIORITY);
		p1.start(); p2.start(); p3.start();
	}
}
class Person extends Thread{
	public void run(){
		for (int i = 0; i < 100; i++) {
			System.out.println("id"+this.getId());
			try {
				sleep(10);
			} catch (InterruptedException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
		}
		System.out.println(this.getId()+","+this.getPriority());
	}
}